﻿using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace Furion.Core
{

    /// <summary>
    /// 产业政策
    /// </summary>
    [Comment("产业政策")]
    public class Policy : IEntity
    {
        public Policy()
        {
            CreatedTime = DateTime.Now;
            UpdatedTime = DateTime.Now;
            Id = Yitter.IdGenerator.YitIdHelper.NextId();
           
        }


        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.None), Comment("主键")]
        public long Id { get; set; }



        /// <summary>
        /// 标题
        /// </summary>
        [MaxLength(100), Comment("标题")]
        public string Title { get; set; }

        /// <summary>
        /// 发布部门
        /// </summary>
        [MaxLength(50), Comment("发布部门")]
        public string PostDepart { get; set; }


        /// <summary>
        /// 简介
        /// </summary>
        [MaxLength(500), Comment("简介")]
        public string Summay { get; set; }


        /// <summary>
        /// 内容
        /// </summary>
        [Comment("内容")]
        public string Contents { get; set; }


        /// <summary>
        /// 数据状态
        /// </summary>
        [Comment("数据状态")]
        public int Statu { get; set; } = 0;

        /// <summary>
        /// 创建时间
        /// </summary>
        [Comment("创建时间")]
        public DateTime CreatedTime { get; set; }


        /// <summary>
        /// 更新时间
        /// </summary>
        [Comment("更新时间")]
        public DateTime UpdatedTime { get; set; }

        /// <summary>
        /// 创建者Id
        /// </summary>
        [Comment("创建者Id")]
        public long? CreatedUserId { get; set; }

        /// <summary>
        /// 创建者名称
        /// </summary>
        [Comment("创建者名称")]
        [MaxLength(20)]
        public string CreatedUserName { get; set; }

        /// <summary>
        /// 修改者Id
        /// </summary>
        [Comment("修改者Id")]
        public long? UpdatedUserId { get; set; }

        /// <summary>
        /// 修改者名称
        /// </summary>
        [Comment("修改者名称")]
        [MaxLength(20)]
        public string UpdatedUserName { get; set; }

        /// <summary>
        /// 软删除
        /// </summary>
        [JsonIgnore]
        [Comment("软删除标记")]
        public bool IsDeleted { get; set; } = false;

    }
}
